Call gtk_widget_get_mapped() in a couple of places before looking at the
widget's parent, since it might be set to a widget that has been
finalized, causing an invalid read.
label = find_label (widget);
if (label == NULL)
{
- if (GTK_IS_BUTTON (widget))
+ if (GTK_IS_BUTTON (widget) && gtk_widget_get_mapped (widget))
/*
* Handle the case where GnomeIconEntry is the mnemonic widget.
* The GtkButton which is a grandchild of the GnomeIconEntry
gtk_widget_get_allocation (widget, &allocation);
+ if (!gtk_widget_get_mapped (widget))
+ return FALSE;
+
viewport = gtk_widget_get_ancestor (widget, GTK_TYPE_VIEWPORT);
if (viewport)
{